<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>02_JS的变量与常量</title>
</head>
<body>
  <script>
    var a = 1;
    console.log(a);
    var b = 3.14;
    console.log(b);
    var c = 'hello';
    console.log(c);
    var d = true;
    console.log(d);
    a = 5.5;
    console.log(a)
    var a = '我又来了';
    console.log(a);

    //ES6新增let关键字声明变量
    let x = 1;
    console.log(x);
    x = 5.5;
    console.log(x);
    //let关键字声明的变量不能重复声明
    // let x = 'let';
    // console.log(x);

    //使用const关键字声明常量
    const PI = 3.14;
    console.log(PI);
    //常量不能重复声明
    // const PI = 3.1415926;
  </script>
</body>
</html>
